<template>
  <view>
    <view class="mask" v-if="show"></view>
    <view class="modal" v-if="show">
      <view class="uni-modal__hd">
        <view class="fz-40 p-20">提示</view></view>
        <view class="uni-modal__bd">该消息所在医院与当前医院不一致，是否进行医院切换？</view>
        <view class="uni-modal__ft">
          <view class="flex1" style="color: rgb(0, 0, 0)" @tap.stop="deny"> 否 </view>
          <view class="flex1" style="color: rgb(0, 122, 255)" @tap.stop="confirm"> 是 </view>
        </view>
      </view>
  </view>
</template>

<script>
import {getHospital} from '@/api/hospital/hospital'

export default {
  name: "change-hospital-dialog",
  data () {
    return {
      hospitalId:"",
      path:'',
      show:false
    }
  },
  onLoad(options){
    // this.hospitalId = options.hospitalId
    // this.path = options.path
    this.show = true
  },
  methods: {
    deny(){
      uni.switchTab({url:'/pages/tabbar/home/home'})
    },
    confirm(){
      if (this.path) {
        uni.reLaunch({url: this.path})
      }else{
        uni.reLaunch({url: '/pages/mine/replace-hospital'})
      }
    }
  }
}
</script>

<style lang="scss">
page {
  background-color: #fff;
}
</style>
<style lang="scss" scoped>
.modal{
  position: fixed;
  z-index: 999;
  width: 80%;
  max-width: 300px;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%,-50%);
  transform: translate(-50%,-50%);
  background-color: #fff;
  text-align: center;
  border-radius: 3px;
  overflow: hidden;
    .uni-modal__bd {
      padding: 1.3em 1.6em 1.3em;
      min-height: 40px;
      font-size: 15px;
      line-height: 1.4;
      color: #999;
      max-height: 400px;
      overflow-x: hidden;
      overflow-y: auto;
    }
    .uni-modal__ft {
      position: relative;
      line-height: 48px;
      font-size: 18px;
      display: -webkit-box;
      display: -webkit-flex;
      display: flex;
      align-items: center;
      border-top:1px solid #eee
    }
  }
.mask {
  position: fixed;
  z-index: 999;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  background: rgba(0,0,0,.5);
}
</style>
